import {
  FormController,
  FormItemController,
  IFormDetailContainerController,
  IFormDetailProvider,
} from "@ibiz-template/runtime";
import { IDEFormDetail } from "@ibiz/model-core";

export class FormItemProvider implements IFormDetailProvider {
  component: string = "IBizFormItem";

  async createController(
    detailModel: IDEFormDetail,
    form: FormController,
    parent: IFormDetailContainerController | undefined
  ): Promise<FormItemController> {
    const c = new FormItemController(detailModel, form, parent);
    await c.init();
    return c;
  }
}
